﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="contactList.ascx.cs" Inherits="VISS.Web.Frontend.Modules.User.Profile.ContactListControl" %>
<%@ Import Namespace="VISS.API.Users" %>
<%@ Import Namespace="NCT.Framework" %>


<% if (ContactRequestResult != null && ContactRequestResult.Count > 0)
   {
       for (int i = 0; i < ContactRequestResult.Count; i++)
       { %>
<div class="search-thumb-box">
    <div class="top">
        <div class="top-icon">
        </div>
        <b><a class="name" href="/profile?u=<%=ContactRequestResult[i].RequestSenderUserKey %>">
            <%=ContactRequestResult[i].SenderName%></a> </b>
    </div>
    <div class="top-info">
        <%=ContactRequestResult[i].SenderAge%>
        Tuổi,
        <%=ContactRequestResult[i].SenderCity%>
    </div>
    <div class="bottm">
        <div class="avatar">
            <a href="<%=AppSettings.RootURL %>profile?u=<%=ContactRequestResult[i].RequestSenderUserKey %>">
                <img src="<%=VISS.Web.Frontend.AvatarUtils.GetAvatarThumbPath(ContactRequestResult[i].SenderAvatarFileName, ContactRequestResult[i].SenderAvatarImageStoreID, ContactRequestResult[i].SenderGender, ContactRequestResult[i].SenderAvatarStatus) %>" />
            </a>
        </div>
        <div class="right">
            <div class="right-item">
                <% if (CanDoAction)
                   { %>
                <a href="album?u=<%=ContactRequestResult[i].RequestSenderUserKey %>">
                    <img src="<%=AppSettings.ResourcesPath %>/images/icon-view-picture.jpg" title="Xem hình ảnh của <%=ContactRequestResult[i].SenderName %>" /></a>
                <% }
                   else
                   { %>
                <a href="javascript:void(0);" onclick="jAlert(VarifiedAccountRequired);">
                    <img src="<%=AppSettings.ResourcesPath %>/images/icon-view-picture.jpg" title="Xem hình ảnh của <%=ContactRequestResult[i].SenderName %>" /></a>
                <% } %>
            </div>
            <div class="right-item">
                <img src="<%=AppSettings.ResourcesPath %>/images/icon-send-message.jpg" onclick="SendMessagePopup('<%= ContactRequestResult[i].RequestSenderUserKey %>');"
                    title="Gửi tin nhắn cho <%=ContactRequestResult[i].SenderName %>" style="cursor: pointer" />
            </div>
        </div>
    </div>
   
    <div style="clear: both; padding: 5px 5px 10px 5px" align="center">
        <div class="btn-accept" onclick="nct.editcontact.allow('<%=ContactRequestResult[i].RequestSenderUserKey %>','<%=UserKey %>',this);"
            title="Đồng ý yêu cầu" style="float: left; margin-right: 5px">
        </div>
        <div class="btn-deny" onclick="nct.editcontact.deny('<%=ContactRequestResult[i].RequestSenderUserKey %>','<%=UserKey %>',this);"
            title="Từ chối yêu cầu" style="float: left">
        </div>
    </div>
    
</div>
        
<%      }%>
       
      
       
   <%}

   else if (ContactResult != null && ContactResult.Count > 0)
   {
       for (int i = 0; i < ContactResult.Count; i++)
       {%>
      
     
<div class="search-thumb-box">
    <div class="top">
        <div class="top-icon">
        </div>
        <b>
        <a class="name" href="/profile?u=<%=ContactResult[i].AllowedUserKey %>">
            <%=ContactResult[i].AllowedUserName%></a> 
            
            </b>
    </div>
     <div class="top-info">
       <%=ContactResult[i].AllowedUserAge%>
        Tuổi,
        <%=ContactResult[i].AllowedUserCity%>
     </div>
    <div class="bottm">
        <div class="avatar">
         <a href="<%=AppSettings.RootURL %>profile?u=<%=ContactResult[i].AllowedUserKey %>">
                <img src="<%=VISS.Web.Frontend.AvatarUtils.GetAvatarThumbPath(ContactResult[i].AllowedUserAvatarFileName, ContactResult[i].AllowedUserAvatarImageStoreID, ContactResult[i].AllowedUserGender, ContactResult[i].AllowedUserAvatarStatus) %>" />
            </a>
        </div>
        <div class="right">
            <div class="right-item">
            <% if (CanDoAction)
                          { %>
                <a href="album?u=<%=ContactResult[i].AllowedUserKey %>">
                    <img src="<%=AppSettings.ResourcesPath %>/images/icon-view-picture.jpg" title="Xem hình ảnh của <%=ContactResult[i].AllowedUserName %>" /></a>
                <% }
                          else
                          { %>
                <a href="javascript:void(0);" onclick="jAlert(VarifiedAccountRequired);">
                    <img src="<%=AppSettings.ResourcesPath %>/images/icon-view-picture.jpg" title="Xem hình ảnh của <%=ContactResult[i].AllowedUserName %>" /></a>
                <% } %>
            
            </div>
              <div class="right-item">
                    <img src="<%=AppSettings.ResourcesPath %>/images/icon-send-message.jpg" onclick="SendMessagePopup('<%= ContactResult[i].AllowedUserKey %>');"
                    title="Gửi tin nhắn cho <%=ContactResult[i].AllowedUserName %>" style=" cursor:pointer" />
        
              </div>
            
        </div>
        
    </div>
	 
	 <div style="clear: both; padding:5px 5px 10px 40px" align="center">
            <div  class="btn-delete" onclick="nct.editcontact.remove('<%=ContactResult[i].AllowedUserKey %>','<%=UserKey %>',this);"
                title="Xóa yêu cầu" style=" float:left" ></div>
      </div>       
    
</div>
       
<%}

   }

   else
   { %>
      <div style=" text-align:center">Bạn không có yêu cầu xem thông tin liên hệ.</div>  
<% } %>